package com.umeng.soexample.mvp.view.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.umeng.soexample.R;
import com.umeng.soexample.bean.HomeRecommendEntity;
import com.umeng.soexample.network.API;

/**
 * 首页推荐接口  列表适配器
 */
public class HomeRecommendAdapter extends BaseQuickAdapter<HomeRecommendEntity.Recommend, BaseViewHolder> {


    public HomeRecommendAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeRecommendEntity.Recommend item) {
        ImageView imageView = helper.getView(R.id.iv_item_recommend_url);
        Glide.with(helper.itemView.getContext()).load(API.BaseUrl + item.recommend_url).into(imageView);

        helper.setText(R.id.tv_item_recommend_name, item.recommend_name);
    }
}
